package ca.venasse.pinventory.part.domain;

import org.axonframework.domain.AggregateIdentifier;
import org.axonframework.eventsourcing.annotation.AbstractAnnotatedAggregateRoot;

import ca.venasse.pinventory.common.Category;
import ca.venasse.pinventory.common.Name;
import ca.venasse.pinventory.part.event.PartCreatedEvent;

public class Part extends AbstractAnnotatedAggregateRoot {

	private static final long serialVersionUID = 1L;

	public Part(AggregateIdentifier aggregateIdentifier) {
		super(aggregateIdentifier);
	}

	public Part(AggregateIdentifier aggregateIdentifier, Name name, Category category) {
		super(aggregateIdentifier);

		apply(new PartCreatedEvent(name, category));
	}

}
